<%--
  User: WFP
  Date: 2017/12/30
  Time: 13:54
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="java.util.*"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="static/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="static/css/webchat.css">
    <script type="text/javascript" src="static/bootstrap-3.3.7-dist/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="static/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    <title>聊天</title>
</head>
<body>
<div class="container">
    <form role="form" method="post" action="/messageServlet" class="form-horizontal">
        <div class="row">
            <div class="col-md-2">
                <div class="form-group">
                    <label >在线人员</label>
                    <div class="online">
                        <select multiple class="form-control " name="users">
                            <c:forEach var="name" items="${applicationScope.alluser}">
                                <option value="${name}"><c:out value="${name}" /></option>
                            </c:forEach>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-md-9">
                <br/>
                <textarea class="form-control " id="show"  rows="15">
                    <c:forEach var="message1" items="${sessionScope.message}">
                        <c:out value="${message1}" />
                    </c:forEach>
                </textarea>
                <br/><br/>
                <div class="form-group">
                    <label for="message" class="col-sm-1 control-label">消息</label>
                    <div class="col-sm-11">
                        <input type="text" class="form-control" name="message" id="message">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-1 col-sm-11">
                        <button type="submit" class="btn btn-default col-md-2">发送</button>
                        <button type="button" id="logout" class="btn btn-default col-md-offset-2  col-md-2">注销</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<script>
    $("#logout").on("click",function () {
        window.location.href="/logoutServlet";
    })
</script>
</body>
</html>
